﻿using System.Collections.Generic;

namespace MsTestUtilities.SolutionAnalysis.Testing
{
    public class ContentFileAssert : CollectionAssertionBase<ContentFile>
    {
        public ContentFileAssert(IEnumerable<ContentFile> contentFiles)
            : base(contentFiles)
        {
        }

        public void DoesntHaveCopyAlways()
        {
            Satisfies(
                c => c.CopyToOutputDirectory,
                warningsAsErrors => warningsAsErrors != CopyToOutputDirectory.Always,
                f => string.Format("File is set to CopyAlways.", f.Path, f.ParentProject.Name));
        }

        protected override string ElementName(ContentFile file)
        {
            return string.Format("{0} > {1}", file.ParentProject.Name, file.Path);
        }
    }
}
